From: Florian Müllner Date: Thu, 13 Feb 2025 01:53:02 +0000 (+0100) Subject: loginManager: Create session proxy asynchronously X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~153^2^2~49 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=a719b7039e11f4c0468b6e2a328d7bba38289db4;p=gnome-shell.git loginManager: Create session proxy asynchronously Most of the function is already asynchronous, except for the initialization of the returned proxy. gjs' D-Bus wrapper gained some convenience API a while ago that makes this trivial enough, so use it. Part-of: --- diff --git a/js/misc/loginManager.js b/js/misc/loginManager.js index 465148492..4bbe7c42c 100644 --- a/js/misc/loginManager.js +++ b/js/misc/loginManager.js @@ -143,8 +143,8 @@ class LoginManagerSystemd extends Signals.EventEmitter { try { const [objectPath] = await this._proxy.GetSessionAsync(sessionId); - this._currentSession = new SystemdLoginSession(Gio.DBus.system, - 'org.freedesktop.login1', objectPath); + this._currentSession = await SystemdLoginSession.newAsync( + Gio.DBus.system, 'org.freedesktop.login1', objectPath); return this._currentSession; } catch (error) { logError(error, 'Could not get a proxy for the current session');